package com.ruoyi.merchant.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.merchant.domain.Fence;
import com.ruoyi.merchant.mapper.FenceMapper;
import com.ruoyi.merchant.service.IFenceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 电子围栏信息Service业务层处理
 * 
 * @author xin.jucheng
 * @date 2024-03-28
 */
@Service
public class FenceServiceImpl implements IFenceService
{
    @Autowired
    private FenceMapper fenceMapper;

    /**
     * 查询电子围栏信息
     * 
     * @param id 电子围栏信息主键
     * @return 电子围栏信息
     */
    @Override
    public Fence selectFenceById(String id)
    {
        return fenceMapper.selectFenceById(id);
    }

    /**
     * 查询电子围栏信息列表
     * 
     * @param fence 电子围栏信息
     * @return 电子围栏信息
     */
    @Override
    public List<Fence> selectFenceList(Fence fence)
    {
        return fenceMapper.selectFenceList(fence);
    }

    /**
     * 新增电子围栏信息
     * 
     * @param fence 电子围栏信息
     * @return 结果
     */
    @Override
    public int insertFence(Fence fence)
    {
        fence.setCreateTime(DateUtils.getNowDate());
        return fenceMapper.insertFence(fence);
    }

    /**
     * 修改电子围栏信息
     * 
     * @param fence 电子围栏信息
     * @return 结果
     */
    @Override
    public int updateFence(Fence fence)
    {
        return fenceMapper.updateFence(fence);
    }

    /**
     * 批量删除电子围栏信息
     * 
     * @param ids 需要删除的电子围栏信息主键
     * @return 结果
     */
    @Override
    public int deleteFenceByIds(String[] ids)
    {
        return fenceMapper.deleteFenceByIds(ids);
    }

    /**
     * 删除电子围栏信息信息
     * 
     * @param id 电子围栏信息主键
     * @return 结果
     */
    @Override
    public int deleteFenceById(String id)
    {
        return fenceMapper.deleteFenceById(id);
    }
}
